package com.blank.task18;

import java.util.List;

public class IndexOfStudent {
    public static Student indexOfStu(int stuNum, List<Student> studentList){
        //遍历studentList集合根据学号查找student
        for(Student stu:studentList){
            if(stuNum == stu.getStuNumber()){
                System.out.println("查找成功!");
                return stu;
            }
        }
        return null;
    }
}
